package com.ruoyi.waybill.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.waybill.mapper.TWayBillExtMapper;
import com.ruoyi.waybill.domain.TWayBillExt;
import com.ruoyi.waybill.service.ITWayBillExtService;

/**
 * 运单扩展Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-16
 */
@Service
public class TWayBillExtServiceImpl implements ITWayBillExtService 
{
    @Autowired
    private TWayBillExtMapper tWayBillExtMapper;

    /**
     * 查询运单扩展
     * 
     * @param wayBillId 运单扩展主键
     * @return 运单扩展
     */
    @Override
    public TWayBillExt selectTWayBillExtByWayBillId(Long wayBillId)
    {
        return tWayBillExtMapper.selectTWayBillExtByWayBillId(wayBillId);
    }

    /**
     * 查询运单扩展列表
     * 
     * @param tWayBillExt 运单扩展
     * @return 运单扩展
     */
    @Override
    public List<TWayBillExt> selectTWayBillExtList(TWayBillExt tWayBillExt)
    {
        return tWayBillExtMapper.selectTWayBillExtList(tWayBillExt);
    }

    /**
     * 新增运单扩展
     * 
     * @param tWayBillExt 运单扩展
     * @return 结果
     */
    @Override
    public int insertTWayBillExt(TWayBillExt tWayBillExt)
    {
        tWayBillExt.setCreateTime(DateUtils.getNowDate());
        return tWayBillExtMapper.insertTWayBillExt(tWayBillExt);
    }

    /**
     * 修改运单扩展
     * 
     * @param tWayBillExt 运单扩展
     * @return 结果
     */
    @Override
    public int updateTWayBillExt(TWayBillExt tWayBillExt)
    {
        tWayBillExt.setUpdateTime(DateUtils.getNowDate());
        return tWayBillExtMapper.updateTWayBillExt(tWayBillExt);
    }

    /**
     * 批量删除运单扩展
     * 
     * @param wayBillIds 需要删除的运单扩展主键
     * @return 结果
     */
    @Override
    public int deleteTWayBillExtByWayBillIds(Long[] wayBillIds)
    {
        return tWayBillExtMapper.deleteTWayBillExtByWayBillIds(wayBillIds);
    }

    /**
     * 删除运单扩展信息
     * 
     * @param wayBillId 运单扩展主键
     * @return 结果
     */
    @Override
    public int deleteTWayBillExtByWayBillId(Long wayBillId)
    {
        return tWayBillExtMapper.deleteTWayBillExtByWayBillId(wayBillId);
    }

    /**
     * 查询统计字段值，月工资单统计
     *
     * @param field 需要查询的字段约定，0，车牌号，
     * @param beginDate 日期
     * @param endDate 日期
     * @return 结果
     */
    @Override
    public List<String> selectStatisticFieldByRecordDate(Integer field, Date beginDate, Date endDate)
    {
        return tWayBillExtMapper.selectStatisticFieldByRecordDate(field, beginDate, endDate);
    }

    /**
     * 查询运单列表，月工资单统计
     *
     * @param field 需要查询的字段约定，0，车牌号，
     * @param tWayBillExt
     * @param beginDate 日期
     * @param endDate 日期
     * @return 结果
     */
    @Override
    public List<TWayBillExt> selectTWayBillExtListUsedByMonthStatistic(Integer field, TWayBillExt tWayBillExt, Date beginDate, Date endDate)
    {
        return tWayBillExtMapper.selectTWayBillExtListUsedByMonthStatistic(field, tWayBillExt, beginDate, endDate);
    }


}
